<template>
  <div class="engineer-worklog-view">
    <el-row gutter="20">
      <!-- 左侧用户选择树 -->
      <el-col :span="6" class="left-panel">
        <el-card shadow="never" class="user-tree-card">
          <div class="panel-header">
            <div class="panel-title">
              <i class="el-icon-user-solid panel-icon"></i>
              <span>用户选择</span>
            </div>
            <div class="panel-subtitle">选择查看用户工时</div>
          </div>
          <div class="search-container">
            <el-input 
              v-model="userFilter" 
              placeholder="搜索用户或部门" 
              size="small" 
              clearable
              prefix-icon="el-icon-search"
              class="search-input"
            />
          </div>
          <div class="tree-container">
            <el-tree
              :data="userTreeData"
              :props="userTreeProps"
              node-key="id"
              highlight-current
              :filter-node-method="filterUserNode"
              @node-click="handleUserSelect"
              ref="userTreeRef"
              :default-expanded-keys="userDefaultExpandedKeys"
              class="user-tree"
            >
              <template #default="{ node, data }">
                <div 
                  class="tree-node-content" 
                  :data-is-dept="data.isDept" 
                  :data-is-user="data.isUser"
                >
                  <i v-if="data.isDept" class="el-icon-office-building tree-node-icon dept-icon"></i>
                  <i v-else class="el-icon-user tree-node-icon user-icon"></i>
                  <span class="tree-node-label" :class="{ 'is-dept': data.isDept, 'is-user': data.isUser }">
                    {{ node.label }}
                  </span>
                  <el-tag v-if="data.isUser && selectedUser && selectedUser.id === data.id" size="mini" type="success">
                    当前
                  </el-tag>
                </div>
              </template>
            </el-tree>
          </div>
        </el-card>
      </el-col>

      <!-- 右侧主内容区 -->
      <el-col :span="18" class="right-panel">
        <!-- 页面标题 -->
        <div class="page-header">
          <h2>个人工时</h2>
          <span v-if="selectedUser" class="selected-user">当前查看：{{ selectedUser.nickName }}</span>
        </div>

        <!-- 未选择用户时的提示 -->
        <el-empty v-if="!selectedUser" description="请选择左侧用户查看工时" />

        <template v-else>
          <!-- 筛选区域 -->
          <el-card class="filter-card">
            <el-row :gutter="20" class="filter-row">
              <el-col :span="8">
                <el-form-item label="日期范围">
                  <el-date-picker
                    v-model="queryParams.dateRange"
                    type="daterange"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                    value-format="YYYY-MM-DD"
                    style="width: 100%"
                    @change="handleDateRangeChange"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="项目选择">
                  <el-select v-model="queryParams.projectId" placeholder="请选择项目" clearable style="width: 100%">
                    <el-option
                      v-for="project in projectOptions"
                      :key="project.projectId"
                      :label="project.projectName"
                      :value="project.projectId"
                    />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="审批状态">
                  <el-select v-model="queryParams.finalStatus" placeholder="请选择状态" clearable style="width: 100%">
                    <el-option label="全部" value="" />
                    <el-option label="待归档" value="pending" />
                    <el-option label="已归档" value="archived" />
                    <el-option label="已驳回" value="rejected" />
                    <el-option label="已退回" value="returned" />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="4">
                <el-form-item>
                  <el-button type="primary" icon="Search" @click="handleSearch">搜索</el-button>
                  <el-button icon="Refresh" @click="handleReset">重置</el-button>
                </el-form-item>
              </el-col>
            </el-row>
          </el-card>

          <!-- 汇总卡片区 -->
          <el-row :gutter="15" class="summary-cards">
            <el-col :span="6">
              <el-card class="summary-card">
                <div class="card-content">
                  <div class="card-icon total">
                    <i class="el-icon-time"></i>
                  </div>
                  <div class="card-info">
                    <div class="card-title">总工时</div>
                    <div class="card-value">{{ summaryData.totalHours || 0 }}<span class="unit">h</span></div>
                  </div>
                </div>
              </el-card>
            </el-col>
            <el-col :span="6">
              <el-card class="summary-card">
                <div class="card-content">
                  <div class="card-icon overtime">
                    <i class="el-icon-warning"></i>
                  </div>
                  <div class="card-info">
                    <div class="card-title">加班工时</div>
                    <div class="card-value">{{ summaryData.totalOvertimeHours || 0 }}<span class="unit">h</span></div>
                  </div>
                </div>
              </el-card>
            </el-col>
            <el-col :span="6">
              <el-card class="summary-card">
                <div class="card-content">
                  <div class="card-icon tasks">
                    <i class="el-icon-document"></i>
                  </div>
                  <div class="card-info">
                    <div class="card-title">参与任务</div>
                    <div class="card-value">{{ summaryData.totalTasks || 0 }}<span class="unit">个</span></div>
                  </div>
                </div>
              </el-card>
            </el-col>
            <el-col :span="6">
              <el-card class="summary-card">
                <div class="card-content">
                  <div class="card-icon records">
                    <i class="el-icon-tickets"></i>
                  </div>
                  <div class="card-info">
                    <div class="card-title">工时记录</div>
                    <div class="card-value">{{ summaryData.totalRecords || 0 }}<span class="unit">条</span></div>
                  </div>
                </div>
              </el-card>
            </el-col>
          </el-row>

          <!-- 工时明细列表 -->
          <el-card class="table-card">
            <template #header>
              <div class="card-header">
                <span>任务明细列表</span>
              </div>
            </template>
            <el-table
              v-loading="loading"
              :data="worklogList"
              style="width: 100%"
              :header-cell-style="{ background: '#f5f7fa', fontWeight: 'bold' }"
              :empty-text="loading ? '加载中...' : '暂无数据'"
              stripe
              border
            >
              <el-table-column prop="projectId" label="项目编号" width="120">
                <template #default="scope">
                  <el-tag type="info" effect="plain" size="small">{{ scope.row.projectId }}</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="projectName" label="项目名称" width="140" show-overflow-tooltip>
                <template #default="scope">
                  <div class="project-info">
                    <i class="el-icon-folder" style="color: #409eff; margin-right: 4px;"></i>
                    <span>{{ scope.row.projectName }}</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="taskCode" label="任务编号" width="120">
                <template #default="scope">
                  <el-tag type="success" effect="plain" size="small">{{ scope.row.taskCode }}</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="taskName" label="任务名称" width="120" show-overflow-tooltip />
              <el-table-column prop="taskDesc" label="任务描述" min-width="150" show-overflow-tooltip />
              <el-table-column prop="status" label="任务状态" width="90" align="center">
                <template #default="scope">
                  <span :class="['status-tag', getTaskStatusColor(scope.row.status)]">
                    {{ getTaskStatusText(scope.row.status) }}
                  </span>
                </template>
              </el-table-column>
              <el-table-column prop="priority" label="优先级" width="80" align="center">
                <template #default="scope">
                  <el-tag 
                    :type="getPriorityType(scope.row.priority)" 
                    effect="plain" 
                    size="small"
                  >
                    {{ getPriorityText(scope.row.priority) }}
                  </el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="myTotalHours" label="我的总工时" width="110" align="center">
                <template #default="scope">
                  <div class="hours-info">
                    <i class="el-icon-time" style="color: #67c23a; margin-right: 4px;"></i>
                    <span class="hours-value">{{ scope.row.myTotalHours || 0 }}h</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="myOvertimeHours" label="加班工时" width="100" align="center">
                <template #default="scope">
                  <div class="overtime-info">
                    <i class="el-icon-warning" style="color: #e6a23c; margin-right: 4px;"></i>
                    <span class="overtime-value">{{ scope.row.myOvertimeHours || 0 }}h</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="worklogCount" label="工时记录数" width="100" align="center">
                <template #default="scope">
                  <el-tag type="primary" effect="plain" size="small">{{ scope.row.worklogCount || 0 }}条</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="startTime" label="开始时间" width="110" align="center">
                <template #default="scope">
                  <span v-if="scope.row.startTime">{{ formatDateTime(scope.row.startTime) }}</span>
                  <span v-else class="text-muted">未开始</span>
                </template>
              </el-table-column>
              <el-table-column prop="endTime" label="结束时间" width="110" align="center">
                <template #default="scope">
                  <span v-if="scope.row.endTime">{{ formatDateTime(scope.row.endTime) }}</span>
                  <span v-else class="text-muted">进行中</span>
                </template>
              </el-table-column>
              <el-table-column prop="lastWorkDate" label="最后工作日" width="110" align="center">
                <template #default="scope">
                  <div class="date-info">
                    <i class="el-icon-calendar" style="color: #909399; margin-right: 4px;"></i>
                    <span>{{ scope.row.lastWorkDate || '暂无' }}</span>
                  </div>
                </template>
              </el-table-column>
            </el-table>
            
            <!-- 分页器 -->
            <div class="pagination-wrapper">
              <el-pagination
                v-show="total > 0"
                :current-page="queryParams.pageNum"
                :page-sizes="[10, 20, 50, 100]"
                :page-size="queryParams.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
              />
            </div>
          </el-card>
        </template>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { getMyWorklogSummary, getMyWorklogList, getMyInvolvedProjects } from '@/api/oa/worklog'
import { getUserDeptTree } from '@/api/organizational'

export default {
  name: 'EngineerWorklogView',
  data() {
    return {
      loading: false,
      summaryData: {},
      worklogList: [],
      projectOptions: [],
      total: 0,
      // 用户树相关
      userFilter: '',
      userTreeData: [],
      userTreeProps: { children: 'children', label: 'label' },
      userDefaultExpandedKeys: [],
      selectedUser: null,
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        projectId: null,
        finalStatus: '',
        dateRange: null,
        userId: null,
        beginTime: '',
        endTime: ''
      }
    }
  },
  watch: {
    userFilter(val) {
      this.$refs.userTreeRef && this.$refs.userTreeRef.filter(val)
    }
  },
  created() {
    this.loadProjectOptions()
    this.loadUserTree()
  },
  methods: {

    // 处理日期范围变化
    handleDateRangeChange(dateRange) {
      if (dateRange && dateRange.length === 2) {
        this.queryParams.beginTime = dateRange[0]
        this.queryParams.endTime = dateRange[1]
      } else {
        this.queryParams.beginTime = ''
        this.queryParams.endTime = ''
      }
    },

    // 加载用户树
    async loadUserTree() {
      try {
        const response = await getUserDeptTree()
        if (response.code === 200) {
          this.userTreeData = this.adaptUserTree(response.data)
          if (this.userTreeData.length > 0) {
            this.userDefaultExpandedKeys = [this.userTreeData[0].id]
          }
        }
      } catch (error) {
        console.error('加载用户树失败:', error)
        this.userTreeData = []
      }
    },

    // 适配用户树数据结构
    adaptUserTree(data) {
      return data.map(dept => ({
        id: dept.deptId,
        label: dept.deptName,
        isDept: true,
        children: [
          // 部门下的用户，过滤admin和ry
          ...(dept.userList ? dept.userList.filter(user => user.nickName !== 'admin' && user.nickName !== 'ry').map(user => ({
            id: user.ddUserId,
            label: user.nickName,
            isUser: true,
            ddUserId: user.ddUserId,
            nickName: user.nickName
          })) : []),
          // 子部门
          ...(dept.children ? this.adaptUserTree(dept.children) : [])
        ]
      }))
    },

    // 过滤用户树节点
    filterUserNode(value, data) {
      if (!value) return true
      return data.label.indexOf(value) !== -1
    },

    // 处理用户选择
    handleUserSelect(node) {
      if (node.isUser) {
        this.selectedUser = node
        this.queryParams.userId = node.ddUserId
        // 选择用户后自动加载数据
        this.loadData()
      } else {
        // 点击部门不做处理，阻止选择
        return false
      }
    },

    // 加载项目选项
    async loadProjectOptions() {
      try {
        const response = await getMyInvolvedProjects()
        if (response.code === 200) {
          this.projectOptions = response.data || []
        }
      } catch (error) {
        console.error('加载项目列表失败:', error)
        this.projectOptions = []
      }
    },

    // 加载数据
    async loadData() {
      if (!this.selectedUser) {
        return
      }
      await Promise.all([
        this.loadSummaryData(),
        this.loadWorklogList()
      ])
    },

    // 加载汇总数据
    async loadSummaryData() {
      if (!this.selectedUser) return
      
      try {
        const params = {
          userId: this.queryParams.userId,
          beginTime: this.queryParams.beginTime,
          endTime: this.queryParams.endTime
        }
        const response = await getMyWorklogSummary(params)
        if (response.code === 200) {
          this.summaryData = response.data || {}
        }
      } catch (error) {
        console.error('加载汇总数据失败:', error)
        this.summaryData = {}
      }
    },

    // 加载任务列表
    async loadWorklogList() {
      if (!this.selectedUser) return
      
      this.loading = true
      try {
        const response = await getMyWorklogList(this.queryParams)
        if (response.code === 200) {
          // 返回的是分页数据，包含total和rows
          this.worklogList = response.rows || []
          this.total = response.total || 0
          // 计算汇总数据
          this.calculateSummaryData()
        }
      } catch (error) {
        console.error('加载任务列表失败:', error)
        this.worklogList = []
        this.total = 0
        this.calculateSummaryData()
      } finally {
        this.loading = false
      }
    },

    // 搜索
    handleSearch() {
      this.queryParams.pageNum = 1
      this.loadData()
    },

    // 重置
    handleReset() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 20,
        projectId: null,
        finalStatus: '',
        dateRange: null,
        userId: this.selectedUser ? this.selectedUser.ddUserId : null,
        beginTime: '',
        endTime: ''
      }
      this.loadData()
    },

    // 分页大小变化
    handleSizeChange(val) {
      this.queryParams.pageSize = val
      this.loadWorklogList()
    },

    // 当前页变化
    handleCurrentChange(val) {
      this.queryParams.pageNum = val
      this.loadWorklogList()
    },

    // 查看详情
    handleViewDetail(row) {
      this.$message.info('查看详情功能开发中...')
    },

    // 获取状态颜色
    getStatusColor(status) {
      const statusMap = {
        'pending': 'status-orange',
        'archived': 'status-green',
        'rejected': 'status-red',
        'returned': 'status-gray'
      }
      return statusMap[status] || 'status-default'
    },

    // 获取状态文本
    getStatusText(status) {
      const statusMap = {
        'pending': '待归档',
        'archived': '已归档',
        'rejected': '已驳回',
        'returned': '已退回'
      }
      return statusMap[status] || status
    },

    // 获取任务状态颜色
    getTaskStatusColor(status) {
      const statusMap = {
        '0': 'status-green',    // 已完成 - 绿色
        '1': 'status-blue',     // 进行中 - 蓝色
        '2': 'status-gray',     // 未完成 - 灰色
        '3': 'status-red'       // 延期 - 红色
      }
      return statusMap[status] || 'status-default'
    },

    // 获取任务状态文本
    getTaskStatusText(status) {
      const statusMap = {
        '0': '已完成',
        '1': '进行中',
        '2': '未完成',
        '3': '延期'
      }
      return statusMap[status] || status
    },

    // 获取优先级文本
    getPriorityText(priority) {
      const priorityMap = {
        '1': '高',
        '2': '中',
        '3': '低'
      }
      return priorityMap[priority] || priority
    },

    // 获取优先级类型（用于标签颜色）
    getPriorityType(priority) {
      const typeMap = {
        '1': 'danger',   // 高优先级 - 红色
        '2': 'warning',  // 中优先级 - 橙色
        '3': 'info'      // 低优先级 - 蓝色
      }
      return typeMap[priority] || 'info'
    },

    // 格式化日期时间
    formatDateTime(dateTime) {
      if (!dateTime) return ''
      // 如果是完整的日期时间格式，只取日期部分
      return dateTime.split(' ')[0]
    },

    // 重新计算汇总数据
    calculateSummaryData() {
      if (this.worklogList.length === 0) {
        this.summaryData = {
          totalHours: 0,
          totalOvertimeHours: 0,
          totalTasks: 0,
          totalRecords: 0
        }
        return
      }

      this.summaryData = {
        totalHours: this.worklogList.reduce((sum, item) => sum + (item.myTotalHours || 0), 0),
        totalOvertimeHours: this.worklogList.reduce((sum, item) => sum + (item.myOvertimeHours || 0), 0),
        totalTasks: this.worklogList.length,
        totalRecords: this.worklogList.reduce((sum, item) => sum + (item.worklogCount || 0), 0)
      }
    }
  }
}
</script>

<style scoped>
.engineer-worklog-view {
  padding: 0;
}

.left-panel {
  background: linear-gradient(135deg, #f6f8fc 0%, #f0f4ff 100%);
  border-right: 1px solid #e4e7ed;
  min-height: 85vh;
  padding-right: 0;
  position: relative;
}

.left-panel::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #409eff 0%, #67c23a 100%);
  border-radius: 2px 0 0 2px;
}

.user-tree-card {
  min-height: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px 0 rgba(80,120,255,0.08);
  padding: 20px 16px;
  border: 1px solid rgba(64, 158, 255, 0.1);
  transition: all 0.3s ease;
}

.user-tree-card:hover {
  box-shadow: 0 6px 30px 0 rgba(80,120,255,0.12);
  transform: translateY(-2px);
}

.panel-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f4ff;
}

.panel-title {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 18px;
  color: #2d3a4b;
  margin-bottom: 6px;
}

.panel-icon {
  font-size: 20px;
  color: #409eff;
  margin-right: 8px;
}

.panel-subtitle {
  font-size: 12px;
  color: #909399;
  font-weight: 400;
}

.search-container {
  margin-bottom: 16px;
}

.search-input {
  border-radius: 20px;
}

.search-input :deep(.el-input__inner) {
  border-radius: 20px;
  border: 1px solid #e4e7ed;
  transition: all 0.3s ease;
}

.search-input :deep(.el-input__inner:focus) {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}

.tree-container {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.tree-container::-webkit-scrollbar {
  width: 4px;
}

.tree-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.tree-container::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 2px;
}

.tree-container::-webkit-scrollbar-thumb:hover {
  background: #909399;
}

.user-tree {
  background: transparent;
  font-size: 14px;
}

.user-tree :deep(.el-tree-node__content) {
  height: 36px;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: all 0.3s ease;
  padding: 0 8px;
}

.user-tree :deep(.el-tree-node__content:hover) {
  background: linear-gradient(90deg, #ecf5ff 0%, #f0f9ff 100%) !important;
  transform: translateX(4px);
}

/* 部门节点样式 - 不可选择 */
.user-tree :deep(.el-tree-node__content[data-is-dept="true"]) {
  cursor: default;
}

.user-tree :deep(.el-tree-node__content[data-is-dept="true"]:hover) {
  background: rgba(64, 158, 255, 0.05) !important;
  transform: none !important;
}

/* 用户节点样式 - 可选择 */
.user-tree :deep(.el-tree-node__content[data-is-user="true"]) {
  cursor: pointer;
}

.user-tree :deep(.el-tree-node__content[data-is-user="true"]:hover) {
  background: linear-gradient(90deg, #ecf5ff 0%, #f0f9ff 100%) !important;
  transform: translateX(4px);
}

.user-tree :deep(.el-tree-node.is-current > .el-tree-node__content) {
  background: linear-gradient(90deg, #409eff 0%, #67c23a 100%) !important;
  color: white;
  font-weight: 500;
}

.user-tree :deep(.el-tree-node__expand-icon) {
  color: #909399;
  font-size: 12px;
}

.tree-node-content {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}

.tree-node-icon {
  margin-right: 8px;
  font-size: 14px;
}

.dept-icon {
  color: #409eff;
}

.user-icon {
  color: #67c23a;
}

.tree-node-label {
  flex: 1;
  font-size: 13px;
  font-weight: 400;
}

.tree-node-label.is-dept {
  font-weight: 500;
  color: #409eff !important;
  cursor: default;
}

.tree-node-label.is-user {
  color: #606266 !important;
  cursor: pointer;
}

/* 只有当前选中的用户节点才使用白色文字 */
.user-tree :deep(.el-tree-node.is-current > .el-tree-node__content) .tree-node-label.is-user {
  color: white !important;
}

.user-tree :deep(.el-tree-node.is-current > .el-tree-node__content) .tree-node-icon {
  color: white !important;
}

.right-panel {
  padding-left: 20px;
}

.page-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #2d3a4b;
}

.selected-user {
  font-size: 14px;
  color: #409eff;
  background: #ecf5ff;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid #d9ecff;
}

.filter-card {
  margin-bottom: 20px;
}

.filter-row {
  align-items: end;
}

.filter-row .el-form-item {
  margin-bottom: 0;
}

.filter-row .el-form-item__label {
  font-weight: 500;
  color: #606266;
}

.summary-cards {
  margin-bottom: 20px;
}

.summary-card {
  height: 100px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(64, 158, 255, 0.15);
}

.card-content {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 10px 0;
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 24px;
  color: #fff;
}

.card-icon.total {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-icon.approved {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.card-icon.overtime {
  background: linear-gradient(135deg, #fcb045 0%, #fd1d1d 100%);
}

.card-icon.tasks {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.card-icon.records {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.card-info {
  flex: 1;
}

.card-title {
  font-size: 14px;
  color: #909399;
  margin-bottom: 8px;
}

.card-value {
  font-size: 28px;
  font-weight: 600;
  color: #2d3a4b;
  line-height: 1;
}

.card-value .unit {
  font-size: 14px;
  color: #909399;
  margin-left: 4px;
}

.table-card {
  margin-bottom: 20px;
}

.card-header {
  font-size: 16px;
  font-weight: 600;
  color: #2d3a4b;
}

.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* 表格相关样式 */
.project-info {
  display: flex;
  align-items: center;
}

.hours-info,
.overtime-info,
.date-info {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hours-value {
  font-weight: 600;
  color: #67c23a;
}

.overtime-value {
  font-weight: 600;
  color: #e6a23c;
}

.text-muted {
  color: #c0c4cc;
  font-size: 12px;
  font-style: italic;
}

/* 状态标签样式继承父组件 */

@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
  }
  
  .filter-row .el-col {
    width: 100%;
    margin-bottom: 15px;
  }
  
  .summary-cards .el-col {
    margin-bottom: 15px;
  }
  
  .card-value {
    font-size: 24px;
  }
  
  .el-table {
    font-size: 12px;
  }
}
</style>
